package com.sky.config;

import com.sky.properties.BaiDuMapProperties;
import com.sky.utils.BaiDuMapUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@Slf4j
public class MapConfiguration {
    @Bean
    @ConditionalOnMissingBean
    public BaiDuMapUtil baiDuMapUtil(BaiDuMapProperties baiDuMapProperties){
        log.info("初始化百度地图对象{}",baiDuMapProperties);
        return new BaiDuMapUtil(baiDuMapProperties.getAK(), baiDuMapProperties.getShopLocation());
    }
}
